/**
 * @Author: hl
 * @Date: 2019/8/16
 * @Last Modified by: hl
 * @Last Modified time:
 */

import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';

// 获取数据字典
export const getdictList = params =>
  axios.get('/dms.web/part/rest/basedata/partInfos', {
    params
  });
// 报损单选择
export const searchBreak = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/queryPartLossByLossNo`, {
    params
  });
// 盘点单选择
export const searchCheck = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/queryPartInventoryLossByInventoryNo`, {
    params
  });
// 报损单查询
export const searchPartLoss = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/queryPartLossItem`, {
    params
  });
// 盘点单查询
export const searchInventoryLoss = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/queryPartInventoryLossItem`, {
    params
  });
// 取消
export const cancel = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/unLock`, {
    params
  });
// 保存
export const save = params => axios.post(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/savePartLoss`, params);
// 作废
export const quit = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/cancellation`, {
    params
  });
// 出库
export const out = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/outStorage`, {
    params
  });
// 备件新增查询
export const queryPart = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/bookpart/queryPartItem`, {
    params
  });
// 备件新增查询
export const queryPartItem = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/queryPartItem`, {
    params
  });
// 查询备件扩展信息
export const queryPartItemInfos = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/queryPartItemInfos`, {
    params
  });
// 查询备件的替换件
// export const queryPartReplace = (params) => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/queryPartReplace`,  {params} );
// 记录缺料信息
export const lackInventory = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/lackInventory`, {
    params
  });
// 出库校验
export const queryPartSalesIfBear = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/queryPartSalesIfBear`, {
    params
  });
// 仓库 -下拉框
export const getStroageList = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partStocks/findUserControlStorageCode`, {
    params
  });
// 品牌下拉框
export const getbrandsdictList = params =>
  axios.get(`${SERVER.DMSCLOUD_SYSBASEDATA}/vehicleProduct/brandsqueryall`, {
    params
  });
// 查询所有员工
export const getAllUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);

//获取报损明细(打印)
export const getPrintData = lossNo => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partBreakage/getPrintData/${lossNo}`);
